<template>
	<div>
		<div class="graybg"></div>
		<!--头部-->
		<header id="header">
			<div class="header header_bg clearfix">
				<div class="header_left pull-left">
					<i class="icon iconfont icon-xia baiColor" onclick="javascript:history.back(-1)">&#xe612;</i>
					<span class="baiColor">账户充值</span>
				</div>
			</div>
		</header>
		<!--==-->
		<div class="main">
			<div class="bankcard marginAuto">
				<!--支付宝-->
					<div class="zhifubao marginAuto clearfix">
						<div class="each_main pull-left">
							<!--<h5 class="pull-left" :class="{activeclor:zhifubao}" @click="zhifubaoclick"></h5>-->
							<h4 class="iconfont pull-left">&#xe62b;</h4>
							<h3 class="pull-left">
								<p>支付宝</p>
								<p>支付宝支付</p>
							</h3>
						</div>
						<!--<div class="each_main pull-right">
							<h5 class="pull-left" :class="{activeclor:yue}" @click="yueclick"></h5>
							<h4 class="iconfont pull-left" style="color: #FCB616;font-size:32px;">&#xe62c;</h4>
							<h3 class="pull-left">
								<p>余额</p>
								<p>余额支付</p>
							</h3>
						</div>-->
					</div>
					<!--银行卡部分【需调整（hiuyuanbuy）】-->
				<!--<router-link to="/myCard">
				<div class="bankcard_main marginAuto clearfix">
					<h5 class="iconfont pull-left" style="color:#053D8F;">&#xe6c6;</h5>
					<div class="bankcard_text pull-left">
						<h4>中国建设银行</h4>
						<p>尾号{{tail}}</p>
					</div>
					<h6 class=" iconfont pull-right">&#xe615;</h6>
				</div>
				</router-link>-->
			</div>
		</div>
		<!--==-->
		<div class="money marginAuto">
			<div class="money_main marginAuto">
				<span>金额</span>
				<input type="number" value="" placeholder="请输入金额" v-model="moneynum"/>
			</div>
		</div>
		<div class="footer_button button baiColor" @click="enter">
			<span>确定充值</span>
		</div>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				imgURL:this.imgURl,
				moneynum:"",	//支付金额
				zhifubao:true,
				yue:false,
				type:"2",//2:支付宝1：余额
				indentid:"",	//订单id
				u_id:""//用户id
			}
		},
		mounted(){
			//获取用户id
			let _this = this;
			var arr = ['u_id'];
			var info = window.localStorage.data;
			var params = new URLSearchParams();
			params.append('token', info);	//客户秘钥（信息）
			params.append('arr',arr);
			this.$axios({
			   url:"Home/Config/getUserField",
				method:"post",
				data:params
			  }).then(function(res){
			  	_this.u_id = res.data.data.u_id
			}).catch(function(err){
				console.log(err)		
			});
		},
		methods:{
			//点击支付宝
//			zhifubaoclick(){
//				this.zhifubao = true;
//				this.yue = false;
//				let _this = this;
//				let type = 2;
//				_this.type = 2;	
//			},
			//点击余额
//			yueclick(){
//				this.zhifubao = false;
//				this.yue = true;
//				let _this = this;
//				let type = 1;
//				_this.type = 1;
//			},
			//点击确认充值
			enter(){
				let _this = this;
				let u_id = _this.u_id;
//				let type = _this.type;//充值类型	2：支付宝 1：余额
				let moneynum = _this.moneynum // 充值金额
				let info = window.localStorage.data;
				let params = new URLSearchParams();
				params.append('token', info);	//客户秘钥（信息）
				params.append('s_user_id',u_id);	//用户id
				params.append('price',moneynum);	//金额
				params.append('type',3);
				if(moneynum == ""){
					alert("请填写您要充值的金额")
				}else{
					window.location.href='http://www.zuqiuxi.top/Home/Alipay/pay_zfb_cz/type/3/token/'+info+'/price/'+moneynum;
				}
				
			}
		}
	}
</script>

<style scoped="scoped">
	@import "../css/public.css";
	.header_left{
		width: 100px;
	}
	.header_left i{
		font-size: 20px;
	}
	.header_left span{
		font-size: 16px;
	}
	.main{
		padding-top: 40px;
	}
	/*={支付宝}=*/
	.zhifubao{
		width: 95%;
		height: 50px;
	}
	.each_main h5{
		width: 10px;
		height: 10px;
		border: 1px solid #ccc;
		margin: 0 5px;
		border-radius: 50%;
		margin-top: 20px;
		background-color:#fff;
	}
	.each_main .activeclor{
		background-color: #FCB317;
		border-color: #FCB317;
	}
	.each_main h4{
		font-size:30px;
		color:#3C98E3;
		line-height: 50px;
	}
	.each_main h3{
		font-size: 14px;
		color: #333;
		line-height: 25px;
		margin-left: 10px;
	}
	/*=银行卡=*/
	.bankcard{
		margin-top: 10px;
		width: 90%;
		background: #fff;
	}
	.bankcard_main{
		width: 95%;
		height: 50px;
		padding: 10px 0;
	}
	.bankcard_main h5{
		font-size: 40px;
		margin-right: 8px;
		line-height: 50px;
	}
	.bankcard_text h4{
		font-size:#333333 ;
		line-height: 20px;
		font-size: 14px;
		margin-bottom: 14px;
	}
	.bankcard_text p{
		font-size:#999;
		line-height: 20px;
		font-size: 12px;
	}
	.bankcard_main h6{
		font-size: 20px;
		line-height: 50px;
		color: #999;
	}
	/*=结束=*/
	.money{
		width: 90%;
		margin-top: 10px;
		background: #fff;
	}
	.money_main{
		width: 95%;
		height: 40px;
		line-height: 38px;
	}
	.money_main input{
		width: 70%;
		height: 38px;
		font-size: 16px;
		color: #333;
		padding-left: 10px;
		line-height: 36px;
	}
	.footer_button{
		background:#F3961F;
		line-height: 30px;
		margin-top: 50px;
		font-size: 18px;
	}
</style>